#include <stdio.h>
#include <stdlib.h>
#include "list.h"
#include "stack.h"

int io_stack_push(io_stack *stack, const void *data)
{
	return io_list_ins_prev(stack, io_list_head(stack), data);
}

int io_stack_pop(io_stack *stack, void **data)
{
	void *el_data = NULL;
	int res = io_list_remove(stack, io_list_head(stack), (void**)&el_data);
	*data = el_data;
	return res;
}
